<div id="headerPan">
  <ul>	
	<% if (current_user != nil) %>
		<li id="loggedIn">Logged in as <%= current_user.login %></li>
		<li class="loginbar" >
			<%= link_to 'Logout', :controller => "sessions", :action => "destroy", :current_uri => request.request_uri %>
		</li>
	<% else %> 
		<% form_tag session_path do %>
		<li ><%= label_tag 'login' %>
		<%= text_field_tag 'login', @login %></li>

		<li><%= label_tag 'password' %>
		<%= password_field_tag 'password', nil %></li>

		<li><%= label_tag 'remember_me', 'Remember me' %>
		<%= check_box_tag 'remember_me', '1', @remember_me %></li>

		<%= hidden_field_tag 'current_uri', request.request_uri %>

		<li><div id="titlebar_submit"><%= submit_tag 'Log in' %></div></li>
		<li style="float:right; padding-right:5px;">
			<%= link_to 'Register', :controller => "users", :action => "new", :current_uri => request.request_uri %>
		</li>
		<% end -%>
	<% end %>
  </ul>
</div>